package strategy;

public class TreeBuilder {

    public static Node createTree() {
        Node root = new Node(1, 1);

        {
            Node node2 = new Node(2, 2);
            root.addChild(node2);

            {
                Node node3 = new Node(3, 5);
                node2.addChild(node3);

                {
                    Node node4 = new Node(4, 9);
                    node3.addChild(node4);

                    Node node5 = new Node(5, 10);
                    node3.addChild(node5);
                }

                Node node6 = new Node(6, 6);
                node2.addChild(node6);

            }

            Node node7 = new Node(7, 3);
            root.addChild(node7);

            Node node8 = new Node(8, 4);
            root.addChild(node8);

            {
                Node node9 = new Node(9, 7);
                node8.addChild(node9);

                {
                    Node node10 = new Node(10, 11);
                    node9.addChild(node10);

                    Node node11 = new Node(11, 12);
                    node9.addChild(node11);
                }

                Node node12 = new Node(12, 8);
                node8.addChild(node12);
            }
        }


        return root;
    }
}
